#include <stdio.h>
#include <unistd.h>
// 全局变量，在系统中用来定义env
extern char **environ;

int main(int argc, char const *argv[])
{
	/* for(int i=0; environ[i]!=NULL; i++)
	{
		printf("%s\n", environ[i]);
	} */

	// int execle(const char *path, const char *arg, ... /*, (char *) NULL, char * const envp[] */);
	char *envp[] = {"AAA=111", "BBB=222", NULL};
	int ret = execle("/usr/bin/env", "env", NULL, envp);
	if(ret == -1)
	{
		perror("执行失败\n");
	}
	return 0;
}
